<?php

namespace App\Admin\Actions\Grid\Customer;

use App\Admin\Forms\Customer\ReceptionAllocateForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;

class ReceptionAllocate extends RowAction
{
    protected $title = '手动分配';

    public function render(): string|Modal
    {
        // 实例化表单类并传递自定义参数
        $form = ReceptionAllocateForm::make()->payload([
            'id' => $this->getKey()
        ]);

        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button('<a href="javascript:void(0)"><i class="feather icon-repeat"> ' . $this->title . '</i></a>');
    }
}
